#!/bin/bash
if [ $# != 2 ]
then
        echo ""
        echo " rename current folder's filename with pattern"
        echo " $0 from_pattern to_pattern "
        echo " eg: $0  20090201 20090301"
        echo ""
        exit 1
fi

for FILENAME in `ls -la *$1* | awk '/^-/{print $NF}'`
        do filename2=`echo ${FILENAME}|sed "s/$1/$2/g"`
        echo ${filename2}
        mv $FILENAME $filename2
        done
